package com.wissen.giskard.server.payroll.services;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import com.wissen.giskard.server.HibernateUtil;
import com.wissen.giskard.server.domainobjects.SalarySlip;

public class GetPayRoll {
	
	
	public List<SalarySlip> getPayRollList()
	{
		List<SalarySlip> payRollList=null;
		try{
			HibernateUtil   hibernateUtil  =  new  HibernateUtil();
			Session  session = hibernateUtil.getSession();
		
			Query getListQuery=session.createQuery("from SalarySlip salaryslip where salaryslip.enable='1' order by creation_date DESC");
			payRollList=getListQuery.list();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
			
			return payRollList;
	}
	
}
